﻿using System;
using System.Windows.Data;

namespace lutianqi.Helpers
{
    public class WeatherIconConverter : IValueConverter
    {
        //结合用户当前的主题名称和天气状况返回主题设定档中对应的WeatherIcon
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
                return "Images/WeatherIcon/" + App.ViewModel.CurrentTheme + "/" + XMLProcessor.GetWeatherIconFileName(App.ViewModel.CurrentTheme, value.ToString());
            else
                return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
